g_object_set (G_OBJECT (priv->vadjustment),
"lower", 0.0,
- "upper", min_height,
+ "upper", MAX (min_height, avail_height),
"page-size", avail_height,
"step-increment", avail_height / 6,
- "page-increment", avail_height,
+ "page-increment", avail_height - avail_height / 6,
NULL);
prev_value = st_adjustment_get_value (priv->vadjustment);
g_object_set (G_OBJECT (priv->hadjustment),
"lower", 0.0,
- "upper", min_width,
+ "upper", MAX (min_width, avail_width),
"page-size", avail_width,
"step-increment", avail_width / 6,
- "page-increment", avail_width,
+ "page-increment", avail_width - avail_width / 6,
NULL);
prev_value = st_adjustment_get_value (priv->hadjustment);
st_adjustment_get_values (priv->vadjustment, &value, &lower, &upper, NULL, NULL, &page_size);
- priv->top_shadow_visible = fabs (value - lower) > 0.1;
- priv->bottom_shadow_visible = fabs (upper - value - page_size) > 0.1;
+ priv->top_shadow_visible = value > lower + 0.1;
+ priv->bottom_shadow_visible = value < upper - page_size - 0.1;
}
else
{
* resize the scroll view small enough so that the scrolled area
* vanishes.
*
- * width-for-height size negotation is similar, with the roles of width
- * and height reversed.
+ * In response to allocate, in addition to normal handling, the
+ * scrollable should also set the limits of the the horizontal and
+ * vertical adjustments that were set on it earlier. The standard
+ * settings are:
+ *
+ * lower: 0
+ * page_size: allocated size (width or height)
+ * upper: MAX (total size of the scrolled area,allocated_size)
+ * step_increment: natural row/column height or a fixed fraction of the page size
+ * page_increment: page_size - step_increment
*/
static void
st_scrollable_base_init (gpointer g_iface)